const App = {
    mixins: [Save],//配置文件，路径/utils/mixins.js
    data() {
        return {
            volunteer_teams:[],
            Recorder:[]
        };
    },
    mounted() {
        this.getCategory();
    },
    // watch:{
    //     'dataForm.News_Content'(val){
    //         console.log(val);
    //     }
    // },
    computed:{
        Personal_Name(){
          return function(val){
            let obj = this.Recorder.filter(i=>i.ID_Card_Number == val)[0];
            if (obj) {
              return obj.Personal_Name
            }else{
              return '';
            }
          }
        },
    },
    methods: {
        getCategory() {
            $.ajax({
              headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryByTableName`,
                type: "POST",
                data: {
                    Data: 'volunteer_teams',
                    Condition: "Row_Status='0'",
                },
                success: (data) => {
                    this.volunteer_teams = data; // 直接使用 this
                },
                complete: (XMLHttpRequest) => {

                  requestPretreatment(XMLHttpRequest);
              },
                dataType: "json",
            });
            $.ajax({
              headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryByTableNameWithOriginal`,
                method: "post",
                data: {
                  Data: "personal_information", //表名
                  Condition: "Row_Status='0'",
                },
                success: (res) => {
                  this.Recorder = res;
                },
                complete: (XMLHttpRequest) => {
                  requestPretreatment(XMLHttpRequest);
                },
              });
        },
        changeVolunteer(val){
            $.ajax({
              headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryBySQLSerialNumber`,
                method: "post",
                data: {
                  SQLSerialNumber: "f_volunteer_teams_members",
                  Condition: window.btoa(unescape(encodeURIComponent(val))),
                  ExtensionCondition: ''
                },
                success: (res) => {
                    this.childDataForm = res;
                },
                complete: (XMLHttpRequest) => {

                  requestPretreatment(XMLHttpRequest);
              },
              });
        }
    },
};
const { createApp, ref } = Vue;
const app = createApp(App);
app.use(ElementPlus,{locale: zhCn});
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
app.component('yl-upload', ylUpload);
app.component('yl-text-editor', ylTextEditor);
const ElMessage = ElementPlus.ElMessage;
app.mount("#app");
